package com.ouc.yyi.user.springcloud.user.wx.service.impl;

import com.ouc.yyi.user.springcloud.user.wx.annocation.BindOperKey;
import com.ouc.yyi.user.springcloud.user.wx.bo.RelPO;
import com.ouc.yyi.user.springcloud.user.wx.bo.WxInfo;
import com.ouc.yyi.user.springcloud.user.wx.dao.GetNewCustomerMapper;
import com.ouc.yyi.user.springcloud.user.wx.service.NewUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: yyi
 * @date: 2022/8/26 10:35
 * @version: 1.0
 **/
@Service
public class NewUserServiceImpl implements NewUserService {

    @Autowired
    private GetNewCustomerMapper newCustomerMapper;

    @Override
    @BindOperKey
    public int insertNewUser(WxInfo wxInfo) {
        System.out.println("service层输出");
        newCustomerMapper.insertWxInfo(wxInfo);
        int id = wxInfo.getId();
        RelPO relPO = new RelPO();
        relPO.setOperKey("766876");
        relPO.setWxId(String.valueOf(id));
        return id;
    }

    @Override
    public int insertBind(RelPO relPO) {
        System.out.println("service层输出");
        return newCustomerMapper.bindCustomer(relPO);
    }
}
